


<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/amazeui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/admin.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/style.css"/>




<!--[if (gte IE 9)|!(IE)]><!-->
	<script type="text/javascript" src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script>
	<script type="text/javascript" src="//cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
  	<script>$(function() {FastClick.attach(document.body);});</script>
<!--<![endif]-->

<!--[if lte IE 8 ]>
	<script type="text/javascript" src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
	<script type="text/javascript" src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script type="text/javascript" src="__STATIC__/weixin/assets/sell/baseui/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<script type="text/javascript" src="//cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>


 


<script> 
</script> 
<link rel="stylesheet" href="__STATIC__/weixin/assets/sell/css/wxmenu.css" >
<script type="text/javascript" src="__STATIC__/weixin/assets/sell/js/jquery.form.js"></script>
<script src="__STATIC__/weixin/assets/sell/js/jquery.qqFace.js"></script>

<script> 
</script>
<script>
button =  {$buttonjson};
key = {$keyjson};
	domain = "22";

</script>

<body>
<div class="am-modal am-modal-no-btn" tabindex="-1" id="authframe_alert">
  <div class="am-modal-dialog"  style="width: 100%; height: 100%;position: absolute;top: 70px;display: block;">
    <div class="am-modal-hd" style="height: 35px;">
		<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
	<iframe id="authiframe" style="width: 100%;height: 100%;"></iframe> 
  </div>
</div>
<!-- comfirm -->
<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">删除确认</div>
    <div class="am-modal-bd" id="del_alert">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
      
    </div>
  </div>
</div>
<!-- comfirm end -->
<!-- alert -->
<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>
<!-- alert end --> 




<!-- content start -->

<div class="admin-content">
   
	<div class="admin-content-body">
		
		<div class="am-margin-top-sm am-margin-left">
			<strong class="am-text-primary am-text-lg">菜单设置</strong> / <small>(演示预览)</small>
		</div>
		
		<div class="menu_setting_area js_editBox am-margin-left">
            <div class="menu_preview_area">
                <div class="mobile_menu_preview">
                    <div class="mobile_hd tc">爱淘客</div>
                    <div class="mobile_bd">
	                    <ul class="pre_menu_list grid_line ui-sortable ui-sortable-disabled " id="menuList">
						<?php $parentCount = count($class);   ?>
						 <empty name="class">
<li class="js_addMenuBox_root pre_menu_item grid_item no_extra size1of1" style="display: list-item;">
								<a href="javascript:void(0);" class="pre_menu_link js_addL1Btn" draggable="false">
									<i class="icon14_menu_add"></i>
									<span class="js_addMenuTips">添加菜单</span>
								</a>
							</li>
<else /> 
<volist id="class" name="class" key="k">
<li class="jsMenu pre_menu_item grid_item jslevel1 ui-sortable ui-sortable-disabled selected size1of3" id="menu_{$k-1}" data-type="{$class.keytype}">
									<a href="javascript:void(0);" class="pre_menu_link" draggable="false">
										<i class="icon_menu_dot js_icon_menu_dot dn" style="display: none;"></i>
										<i class="icon20_common sort_gray"></i>
										<span class="js_l1Title">{$class.name}</span>
									</a>
									<div class="sub_pre_menu_box js_l2TitleBox" style="display:block;">
										<ul class="sub_pre_menu_list">
										<?php $count = 0; ?>
										 <volist id="class1" name="class['class']"  key="k2">
													<li class="jslevel2 jsSubMenu" id="subMenu_menu_{$k-1}_{$k2-1}" data-type="{$class1.keytype}">
													<a href="javascript:void(0);">
														<span class="js_l2Title">{$class1.name} </span>
													</a>
												</li>
													<?php $count++;?>
										</volist>		 	

												<li class="js_addMenuBox" style="<if condition="$count eq 5">display: none; </if>">
												<a href="javascript:void(0);" class="jsSubView js_addL2Btn" title="最多添加5个子菜单" draggable="false">
													<span class="sub_pre_menu_inner js_sub_pre_menu_inner">
														<i class="icon14_menu_add"></i>
													</span>
												</a>
											</li>
										</ul>
										<i class="arrow arrow_out"></i>
										<i class="arrow arrow_in"></i>
									</div>
								</li>
								</volist>
								<li class="js_addMenuBox_root pre_menu_item grid_item no_extra size1of{$parentCount+1}" style="<if condition="$parentCount eq 3">display: none; </if>">
								<a href="javascript:void(0);" class="pre_menu_link js_addL1Btn"  draggable="false">
									<i class="icon14_menu_add"></i>
									<span class="js_addMenuTips">添加菜单</span>
								</a>
							</li>

</empty> 
						
	                  		 
					 
						 
						</ul>
                    </div>
                </div>
            </div>
            <div class="menu_form_area">
            
        	<div id="js_rightBox" class="portable_editor to_left" style="display:block;">
            	<div class="editor_inner" style="position:relative;">
            		<div class="warning">
            			<span>点击左侧菜单栏进行编辑操作</span>
            		</div>
            		<div class="menu_set_area" style="display:none;">
            		<div class="global_mod float_layout menu_form_hd js_second_title_bar">
            			<h4 class="global_info">菜单名称</h4>
            			<div class="global_extra">
                        	<a href="javascript:void(0);" id="jsDelBt" data-id="">删除菜单</a>
                    	</div>
            		</div>

            		<div class="menu_form_bd">
            			<div id="js_innerNone" style="display:block;" class="msg_sender_tips tips_global">已添加子菜单，仅可设置菜单名称。</div>

            			<div class="frm_control_group js_setNameBox">
            				<label for="" class="frm_label">
                          		<strong class="title js_menuTitle">菜单名称</strong>
                      		</label>

                      		<div class="frm_controls">
                        		<span class="frm_input_box with_counter counter_in append">
                          			<input type="text" class="frm_input js_menu_name" value="" style="vertical-align:top;">
                        		</span>
                        		<p class="frm_msg fail js_titleEorTips dn" style="display: none;">字数超过上限</p>
		                        <p class="frm_msg fail js_titlenoTips dn" style="display: none;">请输入菜单名称</p>
		                        <p class="frm_tips js_titleNolTips">字数不超过4个汉字或8个字母</p>
		                        <p class="frm_tips js_titleNolTipsSubButton" style="display:none;">字数不超过8个汉字或16个字母</p>
		                    </div>

            			</div>

            			<div class="frm_control_group">
            				<label for="" class="frm_label">
                        		<strong class="title js_menuContent">菜单内容</strong>
                      		</label>
                      		<div style="display:inline-block;padding-top:2px;">
                      			<label class="frm_radio_label">
								    <input type="radio" name="docInlineRadio" value="index" checked="checked" />
								    <span>平台模块</span>
								</label>
								<label class="frm_radio_label">
								    <input type="radio" name="docInlineRadio" value="click" />
								    <span>发送消息</span>
								</label>
    							<label class="frm_radio_label">
    								<input type="radio" name="docInlineRadio" value="view" />
    								<span>跳转网页</span>
    							</label>
							</div>

                      		</div>

            			</div>

            			<style>
            				.tab_navs li a{
            					
            				}
            			</style>
            			<div class="menu_content_container">
            				<div class="menu_content send jsMain" id="edit" style="display: block;">
            					<div class="msg_sender" id="eidtDiv">
            						<div class="msg_tab">
            							<div class="tab_navs_panel">
            								<span class="tab_navs_switch_wrp switch_prev js_switch_prev">
            									<span class="tab_navs_switch"></span>
            								</span>
            								<span class="tab_navs_switch_wrp switch_next js_switch_next" style="display:none;">
            									<span class="tab_navs_switch"></span>
            								</span>
            								<div class="tab_navs_wrp">
            									<ul class="tab_navs js_tab_navs" style="margin-left:0;">
            										<li class="tab_nav tab_appmsg width4 selected" data-type="3" data-tab=".js_appmsgArea" data-tooltip="图文消息">
            											<a href="javascript:void(0);" onclick="return false;">&nbsp;
	            											<i class="icon_msg_sender"></i>
	            											<span class="msg_tab_title">图文消息</span>
            											</a>
            										</li>
            										<li class="tab_nav tab_img width4" data-type="2" data-tab=".js_imgArea" data-tooltip="图片">
            											<a href="javascript:void(0);" onclick="return false;">&nbsp;
	            											<i class="icon_msg_sender"></i>
	            											<span class="msg_tab_title">图片</span>
            											</a>
            										</li>
            										<li class="tab_nav tab_text width4 no_extra" data-type="1" data-tab=".js_textArea" data-tooltip="文字">
            											<a href="javascript:void(0);" onclick="return false;">&nbsp;
	            											<i class="icon_msg_sender"></i>
	            											<span class="msg_tab_title">文字</span>
            											</a>
            										</li>
            									</ul>
            								</div>
            							</div>
            							<div class="tab_panel">
	    									<div class="tab_content">
												<div class="js_textArea inner ">
													<div class="text_cover" style="width:100%;border:1px solid #e7e7eb;">
														<textarea id="editor1" name="editor"></textarea>
														<div class="facebox" style="position:relative;"></div>
													</div>
											   	</div>
											</div>

											<div class="tab_content">
												<div class="js_appmsgArea inner ">
											   			
													<div class="tab_cont_cover jsMsgSendTab" data-index="0">
										            	<div class="media_cover news_cover">
													        <div class="create_access type_news">
													            <a class="add_gray_wrp jsMsgSenderPopBt" href="javascript:void(0);" data-type="3" data-index="0" data-am-modal="{target: '#doc-modal-news', closeViaDimmer: 0, width: 1000, height:800}">
										                            <i class="icon36_common add_gray"></i>
										                            <strong>从素材库中选择</strong>
										                        </a>
													        </div>
										                </div>
													    <div class="media_cover news_cover">
													        <div class="create_access">
										                    	<a class="add_gray_wrp" href="index.php?m=Admin&c=Weixin&a=wxmaterialcreatenews" target="_blank">
													                <i class="icon36_common add_gray"></i>
													                <strong>新建图文消息</strong>
													            </a>
													        </div>
													    </div>
													   
													    <div class="show_place news_show"></div>
													    <a href="javascript:void(0);" class="media_del news_del" title="图文" data-type='3'>删除</a>
													</div>	    				
											   	</div>
											</div>
											    
											<div class="tab_content" style="display: none;">
											    <div class="js_imgArea inner ">
											    		<!--type 3图文 2图片 4语音 5视频 -->
										            <div class="tab_cont_cover jsMsgSendTab" data-index="1" data-type="2">
										                <div class="media_cover image_cover">
													        <div class="create_access">
													            <a class="add_gray_wrp jsMsgSenderPopBt image_model" data-type="2" href="javascript:void(0);" data-index="1" data-am-modal="{target: '#doc-modal-image', closeViaDimmer: 0, width: 800, height:800}">
										                            <i class="icon36_common add_gray"></i>
										                            <strong>从素材库中选择</strong>
										                        </a>
													        </div>
										                </div>
										                <div class="media_cover image_cover">
													        <div class="create_access">
													            <a class="add_gray_wrp" id="msgSendImgUploadBt" data-type="2" href="javascript:void(0);">
										                            <i class="icon36_common add_gray"></i>
										                            <strong>上传图片</strong>
										                        </a>
										                        <form method="post" enctype="multipart/form-data" action="index.php?m=Admin&c=Weixin&a=localimage" id="imageForm">
										                           	<input type="file" name="upload_image" id="media_image">
										                        </form>
													        </div>
										                </div>
										                <div class="image_show show_place">
										                	<div class="waiting">
										                		<i class="am-icon-refresh am-icon-spin am-icon-md"></i> 上传中,请稍候
										                	</div>
										                </div>
										                <a href="javascript:void(0);" class="media_del image_del" title="图片" data-type='2'>删除</a>
										            </div>	
											   	</div>
											</div>
										</div>
                     				</div>
            					</div>
            				</div>
            				<!-- url start -->
                     		<div class="menu_content url jsMain" id="url" style="display:none">
			                    <form action="" id="urlForm" onSubmit="return false;">
			                        <p class="menu_content_tips tips_global">订阅者点击该菜单会跳到以下链接</p>
			                        <div class="frm_control_group">
			                            <label for="" class="frm_label">页面地址</label>
			                            <div class="frm_controls select_list_container">
			                              <span class="frm_input_box">
			                                <input type="text" class="frm_input" id="urlText" name="urlText">
			                              </span>
			                              <p style="margin:0;display:none;color:#e15f63;" class="false_url">地址格式错误</p>
			                              <p style="margin:0;color:#8d8d8d;">必须以http://或https://开头</p>
			                            </div>

			                        </div>
			                        <div class="frm_control_group btn_appmsg_wrap">
			                            <div class="frm_controls">
			                              	<a href="javascript:;" id="js_appmsgPop" style="display:none;">从公众号图文消息中选择</a>
			                              	<a href="javascript:void(0);" class='dn btn btn_default' id="js_reChangeAppmsg" style="display:none;">重新选择</a>
			                            </div>
			                        </div>
			                    </form>
			                </div>
                     		<!-- url end -->
                     		<!-- platform start -->
                     		<div class="menu_content platform jsMain" id="platform" style="display:none">
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="home" data-am-ucheck >
							        活动页面 <a target="_blank" href="{:C('itk_wap_url')}">{:C('itk_wap_url')}</a>
							    </label>
							   <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="integralmall" data-am-ucheck>
							        兑换商城 <a target="_blank" href="{:C('itk_wap_url')}{:U('Wap/Gift/index')}}">{:C('itk_wap_url')}{:U('Wap/Gift/index')}</a>
							    </label>
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="share" data-am-ucheck>
							        晒单广场 <a target="_blank" href="{:C('itk_wap_url')}{:U('Wap/Share/index')}">{:C('itk_wap_url')}{:U('Wap/Share/index')}</a>
							    </label>
							<!--    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="help" data-am-ucheck>
							        帮助中心 <a target="_blank" href="http://<?php echo $_SERVER['SERVER_NAME'] ?>">http://<?php echo $_SERVER['SERVER_NAME'] ?></a>
							    </label>-->
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="feedback" data-am-ucheck>
							        建议反馈 <a target="_blank" href="{:C('itk_wap_url')}{:U('Wap/User/msg')}">{:C('itk_wap_url')}{:U('Wap/User/msg')}</a>
							    </label>
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="user" data-am-ucheck>
							        个人中心 <a target="_blank" href="{:C('itk_wap_url')}{:U('Wap/User/index')}">{:C('itk_wap_url')}{:U('Wap/User/index')}</a>
							    </label>
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="lottery"  data-am-ucheck>
							        积分抽奖 <a target="_blank" href="http://<?php echo $_SERVER['SERVER_NAME'] ?>">http://<?php echo $_SERVER['SERVER_NAME'] ?></a>
							    </label>
							    <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="sign" data-am-ucheck> 积分签到
							    </label>
								 <label class="am-radio am-secondary">
							        <input type="radio" name="platform" value="resetpwd" data-am-ucheck> 重置密码
							    </label>
							    <label class="am-radio am-secondary poster_menu">
							        <input type="radio" name="platform" value="poster" class="QR_poster"  data-am-ucheck > 生成二维码海报							    
							    </label>
							    
							    
			                </div>
                     		<!-- platform end -->
            			</div>
            			<p id="menu_tips" style="display:none;margin:0;color:#e15f63;padding-top:10px;">请设置当前菜单内容</p>
            		</div>
            		</div>
            	</div>
      		</div>
    
        </div>
        <div class="tools_box">
	      	<button class="am-btn am-btn-success" id="saveMenu">保存并发布</button>
	    </div>
  </div>
  <footer class="admin-content-footer">
	<hr>
	<p class="am-padding-left">版权</p>
</footer>
  </div>
		


</div>
	
<!-- content end -->

<!-- <include file="public:footer" /> -->
</body>
</html>

<style type="text/css">	
.appmsg_content {
	position:relative;
	width:320px;
	border: 1px solid #e7e7eb;
}
.appmsg_info {
	font-size:13px;
	line-height:20px;
	padding:12px 14px 0;
}
.appmsg_item {
	position:relative;
	padding:12px 14px;
}
.appmsg_date {
	font-weight:400;
	font-style:normal;
}
.appmsg_title {
	margin:0;
	font-weight:400;
	font-style:normal;
	font-size:14px;
	line-height:28px;
	max-height:56px;
	overflow:hidden;
	word-wrap:break-word;
	word-break:break-all;
	color:#222;
	text-align:left;
}
.appmsg_thumb_wrp {
	height:160px;
	overflow:hidden;
	background-repeat: no-repeat;
	background-position:center center;
	background-size:cover;
}
.appmsg_desc {
	padding:5px 0 10px;
	margin:0;
	word-wrap:break-word;
	word-break:break-all;
}
.appmsg_content .cover_appmsg_item {
	position:relative;
	margin:22px 14px;
}
.cover_appmsg_item .appmsg_title {
	font-size:14px;
	position:absolute;
	bottom:0;
	left:0;
	right:0;
	background:rgba(0,0,0,0.6)!important;
}
.cover_appmsg_item .appmsg_title a {
	color:#fff;
}
.has_cover {
	height:102px;
	border-top:1px solid #e7e7eb;
}
.has_cover .appmsg_thumb_wrp {
	float:right;
	width:78px;
	height:78px;
	margin-left:14px;
	margin:0;
}
.has_cover .appmsg_title {
	display:inline-block;
	width:200px;
	line-height:24px;
	max-height:48px;
	overflow: hidden;
	margin-top:14px;
}
.appmsg_title a {
	display:block;
	padding:0 8px;
	color:#222;
}
.newsbox {
	width:30%;
	height:100%;
	float:left;
	margin:0 15px;
}
.newsbox .appmsg_content {
	width:100%	}
.newsbox .appmsg_title a {
	text-align:left;
}
.newsbox .has_cover .appmsg_title {
	width:180px;
}
.newsbox .appmsg_info {
	text-align: left;
}
.newsbox .appmsg_desc {
	text-align: left;
}
.newsDesc {
	position:relative;
	margin-bottom:20px;
}
.chooseNew {
	position:absolute;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color:rgba(0,0,0,0.6);
	z-index:999;
	display:none;
}
.news_table {
	padding:15px 10px;
	height:80%;
	overflow:hidden;
	margin:0;
}
.news_content_box .mT {
	margin-top:25%;
}
.loading {
	display:block;
}
.news_content_box {
	border:1px solid #e7e7eb;
	padding:15px 0;
}
.choose_icon {
	background: transparent url(__STATIC__/weixin/assets/sell/css/images/selected_mask_icon.png) no-repeat 0 0;
	width: 45px;
	height: 38px;
	position:absolute;
	top:45%;
	left:43%;
}
<!--删除修改样式开始-->	.grid_item.no_extra {
	float: none;
	width: auto;
	overflow: hidden;
}
.appmsg_opr_item {
	line-height: 44px;
	height: 44px;
	width:148px;
}
.newsbox ul {
	border-bottom: 1px solid #e7e7eb;
	border-right: 1px solid #e7e7eb;
	border-left: 1px solid #e7e7eb;
	padding-left: 0px;
	background:#e7e7eb;
	margin-bottom:20px;
	position: relative;
}
.newsbox li {
	float:left;
}
.right_del:hover {
	color:#000;
}
.li_left {
	border-right:0.5px solid #ccc;
	cursor:pointer;
}
.li_right {
	cursor:pointer;
}
<!--警告框样式开始-->	.popover {
	width: 290px;
}
.del_confirm .popover {
	display:none;
	position: absolute;
	margin-top: 12px;
	z-index:2001;
}
.del_confirm .popover .popover_inner {
	border: 1px solid #d9dadc;
	word-wrap: break-word;
	word-break: break-all;
	padding: 30px;
	background-color: #fff;
	-webkit-box-shadow: none;
	width:216px;
	height:136px;
}
.tl {
	text-align: left;
}
.del_confirm .popover_content p {
	display: block;
	-webkit-margin-before: 1em;
	-webkit-margin-after: 1em;
	-webkit-margin-start: 0px;
	-webkit-margin-end: 0px;
	margin: 0;
}
.popover .popover_bar {
	text-align: justify;
	text-justify: distribute-all-lines;
	font-size: 0;
	width:100%;
}
.popover .popover_bar .btn {
	/*margin-top: 18px;*/
	
}
.btn {
	min-width: 60px;
	display: inline-block;
	overflow: visible;
	padding: 0 22px;
	height: 30px;
	line-height: 30px;
	vertical-align: middle;
	text-align: center;
	text-decoration: none;
	border-radius: 3px;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	font-size: 14px;
	border-width: 1px;
	border-style: solid;
	cursor: pointer;
	margin-left:12px;
}
.btn_primary {
	background-color: #44b549;
	background-image: -moz-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#44b549),to(#44b549));
	background-image: -webkit-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -o-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: linear-gradient(to bottom,#44b549 0,#44b549 100%);
	border-color: #44b549;
	color: #fff;
	margin-top:18px;
	margin-left:0px;
}
.popover_bar a {
	outline: 0;
}
.btn_primary:hover {
	color:fff;
}
.btn_default:hover {
	background-color: #e7e7eb;
	background-image: -moz-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#e7e7eb),to(#e7e7eb));
	background-image: -webkit-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -o-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: linear-gradient(to bottom,#e7e7eb 0,#e7e7eb 100%);
	border-color: #dadbe0;
	box-shadow: none;
	-moz-box-shadow: none;
	-webkit-box-shadow: none;
	color: #000;
	!important
}
.btn_default {
	margin-top:18px;
	margin-right:-10px;
	border:#e7e7eb solid 1px;
	color:#000;
}
.btn:hover {
	text-decoration: none;
}
.t1 {
	font-size:14px;
}
.del_confirm .popover .popover_arrow_out {
	top: 0;
}
.del_confirm .popover .popover_arrow {
	position: absolute;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	display: inline-block;
	width: 0;
	height: 0;
	border-width: 8px;
	border-style: dashed;
	border-color: transparent;
	border-top-width: 0;
	border-bottom-color: #d9dadc;
	border-bottom-style: solid;
}
.del_confirm .popover .popover_arrow_in {
	border-bottom-color: #fff;
	top: 1px;
}
.edit_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	left:55px;
}
.edit_confirm p {
	font-size:12px;
}
.edit_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.edit_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
.del_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	right:51px;
}
.del_confirm p {
	font-size:12px;
}
.del_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.del_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
<!--警告框样式结束-->	<!--介绍-->
</style>

<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/wxkeyword.css" />
<!--回复图文项 start-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-news" data-id="3">
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">
		   		选择图文素材
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="am-cf">
				<button type="button" style="background:#5eb95e;border-color:#5eb95e;border-radius:3px;" class="am-margin-sm am-fl am-btn am-btn-secondary type_news getMaterial">重新获取图文</button>
				<button type="submit" class="am-fl am-btn am-margin-sm am-btn-secondary" id="material_up" style="display:none;margin-left:0px;background:#5eb95e;border-color:#5eb95e; border-radius:3px;" disabled data-start="">上一页</button>
				<button type="submit" class="am-fl am-margin-sm am-btn am-btn-secondary" style="margin-left:0px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;display:none;"  id="material_down" data-start="">下一页
				</button>
				<button type="button" class="am-btn am-btn-secondary" style="float:right;margin-right:21px;margin-top:10px;"><a href="/wxmaterial/createnews.html" target="_blank" style="color:#fff;">+ 新建图文消息</a></button>
		    </div>
		    <div class="news_table">
		    	<div class="news_content_box" style="width:100%;height:100%;overflow:overlay;">
		    		<div class="loading mT">
		    			<i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候
		    		</div>
		    	</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" data-id="" id="edit_news" data-src="" data-title="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
	</div>
	<!--回复图文项 end-->
	
	
	<!--回复图片项 star-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-image" data-id="2">
    
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">选择图片
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="image_table">
		    	<form method="post" enctype="multipart/form-data" name="form_image" id="image_upload" action="/wxautoreply/local_image.html " style="display:none;" >
						<input type="file" name="upload_image" value="" class="addimage" style="opacity:0" id="upload_image"  accept="image/*" multiple="multiple"/>
					</form>
		    	<div class="file_local"> 
					<button type="button" id="image_agin" class="image_model am-fl am-btn am-btn-secondary" style="margin-left:10px;border-radius:3px;background:#5eb95e;border-color:#5eb95e;" >重新获取图片</button>
					<button id="last_image" type="button" class=" am-fl am-btn am-btn-secondary" disabled style="margin-left:10px;background:#5eb95e;border-color:#5eb95e;display:none;border-radius:3px;" data-start="" />上一页
					</button>
					<button id="next_image" type="button" class="am-fl am-btn am-btn-secondary" style="display:none;margin-left:10px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;" data-start="" />下一页
					</button>
		    		<button type="button" class="am-btn am-btn-secondary file_image" style="float:right;margin-right:10px;" >本地上传</button>
		    	</div>
		    	<div class="image_list" style="margin-top:32px;"><i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i></div>
				<div class="ima_showbutton">
					
				</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" id="edit_image" data-id="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
        
	</div>
	<!--回复图片项 end-->
	
	<script>
	var gTencentPicUrl = '{$TencentPicturePre}';
		$(function(){
			//选择图文
			$('.news_content_box').on('mouseover','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$(this).children('.appmsg_content').css('border','1px solid #5eb95e');
				$('.choose').css('border','1px solid #e7e7eb');
			});
			$('.news_content_box').on('mouseout','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$('.newsDesc .appmsg_content').css('border','1px solid #e7e7eb');
			})

			$('.news_content_box').on('click','.newsDesc',function(){
				$('.newsbox .appmsg_content').removeClass('chooseicon');
				$('.newsbox .appmsg_content').removeClass('choose');
				$('.chooseNew').hide();
				$(this).children('.chooseNew').show();
				$(this).children('.chooseNew').html('<div class="choose_icon"></div>');
				$(this).children('.appmsg_content').addClass('choose');
				$('#edit_news').removeClass('am-disabled');
			});

			$('.getMaterial').click(function(){
				$('.newsbox').remove();
				$('.news_content_box').html('<div class="loading mT"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
			});
			//图文列表
			$('.type_news').click(function(){
				
				var news_content_length= $('.news_content_box').html().length;
				$('.type_news').ajaxSubmit({
					data:{"type":3},
					type:'post',
					url:'index.php?m=Admin&c=Weixin&a=wxmaterialgetnewsjson',
					beforeSubmit:function(){
						if(news_content_length>129){
							return false;
						};
					},
					success:function(data){
						var $newsList = data.item;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						$('#material_up').attr('data-start',0);
						$('#material_down').attr('data-start',10);
						$('#material_up').attr('disabled',true);
						$('#material_down').attr('disabled',false);
						if($newsList.length<data.total_count){
							$('#material_up').css('display','block');
							$('#material_down').css('display','block');
						}else{
							$('#material_up').css('display','none');
							$('#material_down').css('display','none');
						}
						
					}
				});
			});
			
			//重新获取图片
			$('#image_agin').click(function(){
			
				$('.show_image').remove();
				$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
			
			})
			
			//图片模态框显示
			$('.image_model').click(function(){
			$('.image_model').ajaxSubmit({
				url:"index.php?m=Admin&c=Weixin&a=wxgetimagejson",
				type:'get',
				//data:{'start':$('#next_image').attr('data-start')},
				beforeSubmit:function(){
					if($('.image_list').html().length>80){
								return false;
							}
				},
				success:function(data){
					var $image_array = data.item; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+'{$TencentPicturePre}'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array.length<data.total_count){
						$('#next_image').css('display','block');
						$('#last_image').css('display','block');
					}else{
						$('#next_image').css('display','none');
						$('#last_image').css('display','none');
					}
				},
				error:function(){
					console.log("失败");
				}
			});
			$('#next_image').attr('data-start',20);
			$('#last_image').attr('data-start',0);
	})
	
	
		});
//下一页图片
$("#next_image").click(function(){
		$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"index.php?m=Admin&c=Weixin&a=wxgetimagejson",
				type:'get',
				data:{'start':$('#next_image').attr('data-start')},
				success:function(data){
					var $image_array = data.item; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+'{$TencentPicturePre}'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array!=''){
						var next_image = parseInt($('#next_image').attr('data-start'));
						var next_image_start = next_image+20;
						$('#next_image').attr('data-start',next_image_start);
						var last_image = parseInt($('#last_image').attr('data-start'));
						var last_image_start =	next_image-20;
						$('#last_image').attr('data-start',last_image_start);
						$('#last_image').attr('disabled',false);
					}else{
						$('.image_list').html('<div style="margin-top:255px;">没有了</div>');
						$('#next_image').attr('disabled',true);
						var rest_last_image = parseInt($('#last_image').attr('data-start'))+20;
						$('#last_image').attr('data-start',rest_last_image);
					}
				},
			});
})
//上一页图片
$("#last_image").click(function(){
	$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"index.php?m=Admin&c=Weixin&a=wxgetimagejson",
				type:'get',
				data:{'start':$('#last_image').attr('data-start')},
				success:function(data){
					var $image_array = data.item; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+'{$TencentPicturePre}'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($("#next_image").attr('disabled')){
						var a = parseInt($("#next_image").attr('data-start'))+20;
						$("#next_image").attr('data-start',a);
						//var b =	parseInt($("#last_image").attr('data-start'))+20;
						//$("#last_image").attr('data-start',b);
					}
					var last_image = parseInt($('#last_image').attr('data-start'));
					var last_image_start = last_image-20;
					$('#last_image').attr('data-start',last_image_start);
					var next_image = parseInt($('#next_image').attr('data-start'));
					var next_image_start = next_image-20;
					$('#next_image').attr('data-start',next_image_start);
					$('#next_image').attr('disabled',false);
					if($('#last_image').attr('data-start')<0){
						$('#last_image').attr('disabled',true);
					}
				},
			});
})


//上传图片
$('.file_image').click(function(){
	$('.addimage').click();
});
$('#upload_image').change(
	function(){
	$('.image_table .show_image').eq(0).before('<div class="show_image"><span class="text_center"><i class="am-icon-refresh am-icon-spin"></i> 上传中</span></div>');
			if($('.image_table .show_image').length>=20){
				$('.image_table .show_image:last-child').remove();
			}
			$('#edit_image').attr('disabled',true);
			$('.file_image').attr('disabled',true);
			$('.file_image').html('<i class="am-icon-spinner am-icon-spin"></i> 上传中');
			$('#image_upload').ajaxSubmit({
				dataType:'json',
				success:function(data){
					if(data.info == 1){
						$('#edit_image').attr('disabled',false);
						$('.file_image').attr('disabled',false);
						$('.file_image').html('本地上传');
						
					$('.image_table .show_image').eq(0).html('<div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src='+'{$TencentPicturePre}'+data.image_url+' alt="" class="selected_image">');
					}
				}
			});
		}
	
	);

//下一页图文
$('#material_down').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
	
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'index.php?m=Admin&c=Weixin&a=wxmaterialgetnewsjson',
		success:function(data){
			 
				var $newsList = data.item;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if(data.item!=''){
											var material_down_start = parseInt($('#material_down').attr('data-start'));
											var material_up_reststart = material_down_start-10;
											$('#material_up').attr('data-start',material_up_reststart);
											var material_down_reststart = material_down_start+10;
											$('#material_down').attr('data-start',material_down_reststart);
											$('#material_up').attr("disabled",false);
										}else{
												$('.news_content_box').html('<div class="loading mT" style="display:block;">没有了...</div>');
												var rest_upstart= parseInt($('#material_up').attr('data-start'))+10;
												$('#material_up').attr('data-start',rest_upstart);
												$('#material_down').attr("disabled",true);
												$('#material_up').attr("disabled",false);
										}
			 
		}
	})
});

//上一页图文
$('#material_up').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'index.php?m=Admin&c=Weixin&a=wxmaterialgetnewsjson',
		success:function(data){
			if(data.info == 1){
				var $newsList = data.item;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+'{$TencentPicturePre}'+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if($('#material_down').attr('disabled')){
							var down_start =  parseInt($('#material_down').attr('data-start'))+10;
							$('#material_down').attr('data-start',down_start);
						}
						$('#material_down').attr('disabled',false);
						var par_start =  parseInt($('#material_up').attr('data-start'))-10;
						$('#material_up').attr('data-start',par_start);
						var down_start = parseInt($('#material_down').attr('data-start'))-10;
						$('#material_down').attr('data-start',down_start);
						if($('#material_up').attr('data-start')<0){
							$('#material_up').attr('disabled',true);
						}
			}
		}
	})
});


//选择图片素材
$('.image_table').on('click','.selected_image',function(){	
	var image_id = $(this).attr('data-id');
	$('#edit_image').attr('data-id',image_id);
	$('.selected_mask').css({'display':'none'});
	$(this).siblings('.selected_mask').css({'display':'block'});
	$(".selected_image").removeClass("choose_image");
	$(this).addClass("choose_image");
	if(image_id!=''){
		$('#edit_image').removeClass('am-disabled');
	}else{
		$('#edit_image').addClass('am-disabled');
	}

});


$('#edit_image').click(function(){
	$('#edit_image').addClass('am-disabled');
	$('.selected_mask').hide();
});
		
</script>
<script type="text/javascript" src="__STATIC__/weixin/assets/sell/js/wxmenu.js?v002"></script>

	<script>
		$(function(){
			//平台模块
			$('input[name=platform][type=radio]').change(function(){

				$('.menu_content_container').css('border-color','#e7e7eb');
				$('#menu_tips').hide();

				var valueType = $(this).val();
				var id = $('#jsDelBt').attr('data-id');
				var type = $('#jsDelBt').attr('data-type');

				if(type == 2){
					var parentId = $('#'+id).parent().parent().parent('.jslevel1').attr('id');
				}
				var times = new Date().getTime();
				var name = '';
				switch(valueType){
					case 'home'://活动页
						key[id]['indextype'] = 'home';
						name = '活动页面';
					break;

					case 'sign'://签到
						var signkey = 'V004_'+times+'_SIGN';
						if(type == 2){
							button[parentId]['sub_button'][id]['key'] = signkey;
						}else{
							button[id]['key'] = signkey;
						}
						key[id]['indextype'] = 'sign';
						key[id]['keytype'] = 4;
						key[id]['signkey'] = signkey;
						name = '积分签到';
					break;

					case 'poster'://海报
						var posterkey = 'V005_'+times+'_POSTER';
						if(type == 2){
							button[parentId]['sub_button'][id]['key'] = posterkey;
						}else{
							button[id]['key'] = posterkey;
						}
						key[id]['indextype'] = 'poster';
						key[id]['keytype'] = 5;
						key[id]['posterkey'] = posterkey;
						name = '生成海报';
					break;

					case 'user'://个人中心
						key[id]['indextype'] = 'user';
						name = '个人中心'
					break;

					case 'integralmall'://兑换商城
						key[id]['indextype'] = 'integralmall';
						name = '兑换商城';
					break;

					case 'share'://晒单广场
						key[id]['indextype'] = 'share';
						name = '晒单广场';
					break;

					case 'help'://帮助中心
						key[id]['indextype'] = 'help';
						name = '帮助中心';
					break;

					case 'feedback'://建议反馈
						key[id]['indextype'] = 'feedback';
						name = '建议反馈';
					break;
					case 'lottery'://建议反馈
						key[id]['indextype'] = 'lottery';
						name = '积分抽奖';
					break;
					case 'resetpwd'://密码重置
						key[id]['indextype'] = 'resetpwd';
						name = '密码重置';
					break;
					//.....于此处添加其他功能
					default:
					break;
				}
				$('.global_info').text(name);
				$('.js_menu_name').val(name).focus().select();
			});

			//上传图片
			$('#msgSendImgUploadBt').click(function(){
				$('#media_image').click();
			});
			$('#media_image').change(function(){
				var keyType = $('#msgSendImgUploadBt').attr('data-type');
				$('.image_cover').hide();
				$('.image_show,.image_show .waiting').show();
				$('#imageForm').ajaxSubmit({
					dataType:'json',
					success:function(data){
						$('.image_del').show();
						$('.image_show').html('<img src="'+data.image_url+'" class="material_image"/>');
						$('#media_image').replaceWith($('#media_image').clone(true));

						$('.menu_content_container').css('border-color','#e7e7eb');
						$('#menu_tips').hide();

						//获取菜单ID、类型
						var id = $('#jsDelBt').attr('data-id');
						var type = $('#jsDelBt').attr('data-type');

						var times = new Date().getTime();
						key[id]['imageUrl'] = data.image_url;
						key[id]['imageMedia_id'] = data.media_id;
						key[id]['imagekey'] = 'V002_'+times+'_IMAGE';

						if(type == '2'){
							var parentId = $('#'+id).parent().parent().parent('.jslevel1').attr('id');
							button[parentId]['sub_button'][id]['key'] = 'V002_'+times+'_IMAGE';
							
						}else{
							button[id]['key'] = 'V002_'+times+'_IMAGE';
						}
					},
					error:function(){
						$('.image_cover').show();
						$('.image_show,.image_show .waiting').hide();
					}
				});
			});


			//上传菜单
			$('#saveMenu').click(function(){
				var boxArr = new Array('TEXT','IMAGE','NEWS');
				for(var bk in button){
					if(button[bk]['type'] == 'view'){
						if(button[bk]['url'] == ''){
							$('#'+bk).children('.pre_menu_link').click();
							$('.menu_content_container').css('border-color','#e15f63');
							$('#menu_tips').show();
							return false;
						}
					}else if(button[bk]['type'] == 'click'){
						if(button[bk]['key'] == ''){
							$('#'+bk).children('.pre_menu_link').click();
							$('.menu_content_container').css('border-color','#e15f63');
							$('#menu_tips').show();
							return false;
						}else{
							var arr = button[bk]['key'].split('_');
							if(boxArr.indexOf(arr[2]) == -1){
								$('#'+bk).children('.pre_menu_link').click();
								$('.menu_content_container').css('border-color','#e15f63');
								$('#menu_tips').show();
								return false;
							}else if(key[bk]['keytype'] != boxArr.indexOf(arr[2]) + 1){
								$('#'+bk).children('.pre_menu_link').click();
								$('.menu_content_container').css('border-color','#e15f63');
								$('#menu_tips').show();
								return false;
							}
						}
					}else if(button[bk]['type'] == 'index'){
						if(typeof(key[bk]['indextype']) == undefined || key[bk]['indextype'] == ''){
							$('#'+bk).children('.pre_menu_link').click();
							$('.menu_content_container').css('border-color','#e15f63');
							$('#menu_tips').show();
							return false;
						}
					}else if(!button[bk]['type']){
						for(var sk in button[bk]['sub_button']){
							if(button[bk]['sub_button'][sk]['type'] == 'view'){
								if(button[bk]['sub_button'][sk]['url'] == ''){
									$('#'+sk).children('a').click();
									$('.menu_content_container').css('border-color','#e15f63');
									$('#menu_tips').show();
									return false;
								}
							}else if(button[bk]['sub_button'][sk]['type'] == 'click'){
								if(button[bk]['sub_button'][sk]['key'] == ''){
									$('#'+sk).children('a').click();
									$('.menu_content_container').css('border-color','#e15f63');
									$('#menu_tips').show();
									return false;
								}else{
									var subarr = button[bk]['sub_button'][sk]['key'].split('_');
									if(boxArr.indexOf(subarr[2]) == -1){
										$('#'+sk).children('a').click();
										$('.menu_content_container').css('border-color','#e15f63');
										$('#menu_tips').show();
										return false;
									}else if(key[sk]['keytype'] != boxArr.indexOf(subarr[2]) + 1){
										$('#'+sk).children('a').click();
										$('.menu_content_container').css('border-color','#e15f63');
										$('#menu_tips').show();
										return false;
									}
								}
							}else if(button[bk]['sub_button'][sk]['type'] == 'index'){
								if(typeof(key[sk]['indextype']) == undefined || key[sk]['indextype'] == ''){
									$('#'+sk).children('a').click();
									$('.menu_content_container').css('border-color','#e15f63');
									$('#menu_tips').show();
									return false;
								}
							}
						}
					}
				}
				var saveMenu = $(this);
				saveMenu.prop('disabled',true);
				saveMenu.html('<i class="am-icon-spinner am-icon-spin"></i> 保存中');
				$('.js_menu_name').prop('disabled',true);
				$('input[name=docInlineRadio][type=radio]').prop('disabled',true);
	    		$.ajax({
	    			async:true,
	    			type:'post',
	    			data:{"menu":button,"key":key},
	    			url:'index.php?m=Admin&c=Weixin&a=wxmenu',
	    			dataType:'json',
	    			success:function(data){
	    				if(data.status == '1'){
	    					$("#fq_alert_info").text(data.info);
							$('#fq_alert').modal();
	    				}else{
	    					$("#fq_alert_info").text(data.info);
							$('#fq_alert').modal();
	    				}
	    			},
	    			complete:function(XMLHttpRequest,status){
	    				if(XMLHttpRequest.status != 200){
	    					$("#fq_alert_info").text('菜单设置失败，请检查网络连接');
							$('#fq_alert').modal();
	    				}
	    				saveMenu.prop('disabled',false);
						saveMenu.html('保存并发布');
						$('.js_menu_name').prop('disabled',false);
						$('input[name=docInlineRadio][type=radio]').prop('disabled',false);
	    			}
	    		});
	    	});
		})
		
		//检查是否开启邀请功能
		$('.QR_poster').click(function(){
		
			if($('.QR_poster').attr('disabled')==true){
				$("#fq_alert_info").text("请开启邀请功能！");
				$('#fq_alert').modal();
			}
		});
		
	</script>
	<script type="text/javascript" src="__STATIC__/weixin/wysiwyg/js/wysiwyg.js"></script>
    <script type="text/javascript" src="__STATIC__/weixin/wysiwyg/js/wysiwyg-editor.js"></script>
    <script type="text/javascript" src="__STATIC__/weixin/wysiwyg/js/demo.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/js/calendar/calendar-blue.css"/>
<script type="text/javascript" src="__STATIC__/js/calendar/calendar.js"></script>